#ifndef INC_TRACKBALL_H
#define INC_TRACKBALL_H

#include "Quaternion.h"

namespace prog3d {


class Trackball {
  Quaternion orientation;
  Quaternion orientationStart;

  bool started;
  int xStart,yStart;
  int cx,cy;
public:
  Trackball();


  inline const Quaternion &quaternion() {return orientation;}


  void init(int x,int y);
  void start(int x,int y);
  void stop();
  void motion(int x,int y);
  bool isStarted();
  void applyGL();

};

}

#endif
